<?php
class CConfig
{
	static function country_list()
	{
		return array
			(
				array(
					'id'	=> 'vi',
					'name'	=> 'Vietnam'
					),
				array(
					'id'	=> 'th',
					'name'	=> 'Thailand'
					),
				array(
					'id'	=> 'ph',
					'name'	=> 'Philippines'
					),
				array(
					'id'	=> 'ma',
					'name'	=> 'Malaysia'
					),
				array(
					'id'	=> 'id',
					'name'	=> 'Indonesia'
					),
				);
	}
	
	static function getCountryName($p_strCountry)
	{
		$arrData = self::country_list();
		foreach ($arrData as $item)
		{
			if($item["id"] == $p_strCountry)
			{
				return $item["name"];
			}
		}
		return "";
	} 
	
	static function team_list($p_strCountry)
	{	
		$arrData	= array(
			array('id' => GROUP_Administrator,  'name' => 'Adminstrator'),
			array('id' => GROUP_Buying,	'name' =>'Buying'),
			array('id' => GROUP_Inventory,	'name' =>'Sourcing / Hunting'),
			array('id' => GROUP_Marketing,  'name' =>'Marketing'),
			array('id' => GROUP_Content, 'name'=> 'Content'),
			array('id' => GROUP_Product_It, 'name' => 'Product / It'),
			array('id' => GROUP_Finance, 'name'=>	'Finance'),
			array('id' =>GROUP_BI, 'name' => 'BI'),
			array('id' => GROUP_HR, 'name' => 'HR'),
			array('id' => GROUP_GeneralAdministration, 'name' => 'General Administration'),
			array('id' => GROUP_Customer_Service, 'name' => 'Customer Service'),
			array('id' =>GROUP_Warehouse_Fulfillment ,	'name' => 'Warehouse / Fulfillment'),
			array('id' => GROUP_Delivery, 		'name' => 'Delivery')
			);
		return $arrData;
	}
	
	static $priviledgeGroup = array(
		"G0001" => "PARAMETER",
		"G0002" => "Replenishment",
		"G0003" => "Configuration",
		"G0004" => "Archive History"
		);
	
	static $priviledgeFunction = array(
		"F0001" => "Upload Data",
		"F0002" => "Supplier Calendar",
		"F0003" => "Generate Forecast",
		"F0004" => "Validate Forecast",
		"F0005" => "Prepare PO",
		"F0006" => "View Previous Forecast",
		"F0007" => "Create / Edit User",
		"F0008" => "Change Password",
		"F0009" => "CMS",
		"F0010" => "Priviledge Management",
		"F0011" => "View Previous Forecast"
		);
	
	static function link_image()
	{
		return array
			(
				'vi'	=>	'http://static.lazada.vn/p',
				'th'	=>	'http://static.lazada.co.th/p',
				'ph'	=>	'http://static.lazada.com.ph/p',
				'ma'	=>	'http://static.lazada.com.my/p',
				'id'   =>	'http://static.lazada.co.id/p'
				);
	}
	
	public static function getNextDay()
	{
		$now = getdate();
		$current = date('D', mktime($now['hours'], $now['minutes'], $now["seconds"], $now['mon'], $now['mday'], $now['year']));	
		$day="";
		#test
		//$current ='Thu';
		
		if($current =='Sun' || $current =='Sat')
		{
			echo 'Today is sunday or saturday do not work';
			exit;	
		}
		
		if($current =="Fri")
		{
			$day ="Mon";
		}
		elseif($current =="Mon")
		{
			$day ="Tue";
		}
		elseif($current =="Tue")
		{
			$day ="Wed";
		}
		elseif($current =="Wed")
		{
			$day ="Thu";
		}
		elseif($current =="Thu")
		{
			$day ="Fri";
		}	
		return strtolower($day);
	}
	
	public static function getCurrentDay()
	{
		$now = getdate();
		$current = date('D', mktime($now['hours'], $now['minutes'], $now["seconds"], $now['mon'], $now['mday'], $now['year']));	
		#test
		#$current ='Thu';
		return strtolower($current);
	}
	
	public static function getCurrentDayMonthYear()
	{
		$now = getdate();
		$current = date('Ymd', mktime($now['hours'], $now['minutes'], $now["seconds"], $now['mon'], $now['mday'], $now['year']));	
		return $current;
	}
	
	public static function convertWeekDayToNumber($weekday)
	{
		$number =0;
		if($weekday == 'mon')
		{
			$number = 1;
		}
		elseif($weekday == 'tue')
		{
			$number = 2;
		}
		elseif($weekday == 'wed')
		{
			$number = 3;
		}
		elseif($weekday == 'thu')
		{
			$number = 4;
		}
		elseif($weekday == 'fri')
		{
			$number = 5;
		}
		return $number;
	}
	
	static $LogisticType = array(
		"Logistic type 1",
		"Logistic type 2",
		"Logistic type 3",
		"Logistic type 4"
		);
	
	static $LogisticMethod = array(
		"Logistic method 1",
		"Logistic method 2",
		"Logistic method 3",
		"Logistic method 4"
		);
	
	static $LogisticEta = array(
		"Logistic eta 1",
		"Logistic eta 2",
		"Logistic ate 3",
		"Logistic eta 4"
		);
}
?>